function [s_hat,signal] = null_cancel(h,r,rho,nt)

g=h;
gamma=r;

signal=[];

s_hat=zeros(nt,1);
index_glossary=zeros(nt,1);

for m=1:nt
	w=g(:,m);
	z=w'*gamma;
	sk=(bin2qpsk(qpsk2bin(z)));
	hk=h(:,m);
	gamma=gamma-sqrt(rho/nt)*sk*hk;
	s_hat(m)=sk;

	g(:,m)=zeros(nt,1);
end

signal=[];
for m=1:length(r)
	signal=horzcat(signal,qpsk2bin(s_hat(m)));
end
